/***************************************************************************
 *   Copyright (C) 2005 by xihe   *
 *   xihels@163.com                                                        *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef _IM_PACKET_FONT_H_
#define _IM_PACKET_FONT_H_
#include "Packet.h"
/**
 * 如字体颜色啦，等等等等，顺序是
 *     1. 字体修饰属性，bold，italic之类的，1字节，具体的设置是
 *         i.   bit0-bit4用来表示字体大小，所以最大是32
 *         ii.  bit5表示是否bold
 *         iii. bit6表示是否italic
 *         iv.  bit7表示是否underline
 *     2. 颜色Red，1字节
 *     3. 颜色Green，1字节
 *     4. 颜色Blue，1字节
 *     5. 1个未知字节，置0先
 *     6. 消息编码，2字节，0x8602为GB，0x0000为EN，其他未知，好像可以自定义，因为服务器好像不干涉
 *     7. 可变长度的一段信息，字体名后面跟一个回车符，比如0xcb, 0xce, 0xcc, 0xe5表示宋体 
 * 21. 1字节，表示19和20部分的字节长度
 * 22. 包尾部
 */

class ImPacketFont {
    public:
	ImPacketFont();
	~ImPacketFont(){}
	int putBody(uint8_t* buf) const;
    private:
	struct {
	    unsigned size	: 5;
	    unsigned bold	: 1;
	    unsigned italic	: 1;
	    unsigned underline	: 1;
	} font;
	uint8_t red, green, blue;
	string fontName;
};

#endif // _IM_PACKET_FONT_H_

